package com.macro.mall.portal.service;

import com.macro.mall.common.api.CommonResult;
import com.macro.mall.portal.request.CreateOrderReq;
import com.macro.mall.portal.request.QueryOrderReq;
import javax.servlet.http.HttpServletRequest;

/**
 * @ClassName WxPayService
 * @Package com.macro.mall.portal.service
 * @Description TODO
 * @Author wsx
 * @Date 2024/8/719:18
 * @Version V1.0
 * @Copyright yunshan
 */
public interface WxPayService {

    /***
     * 预支付订单
     * @return
     */
    CommonResult<Object> createOrder(CreateOrderReq req) throws Exception ;


    /***
     * 微信支付回调通知
     * @param request
     * @return
     */
    String payNotify(HttpServletRequest request) throws Exception;


    /***
     * 根据商户订单号查询订单 outTradeNo
     * @param req
     * @return
     */
    CommonResult<Object> queryOrderByOrderNo(QueryOrderReq req) ;


    /***
     * 根据支付订单号查询订单 paymentNo
     * @param req
     * @return
     */
    Object queryOrderByPaymentNo(QueryOrderReq req);


    /***
     * 微信申请退款
     * @param outTradeNo 商户订单号
     * @param totalAmount
     * @return
     */
    Object createRefund(String outTradeNo, Long totalAmount);
}
